package com.lmf.mvc.controller;

import com.lmf.mvc.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MyController {
    @Autowired
    private MyService myService;

    @ResponseBody
    @RequestMapping("/hello")
    public String hello() {
        String hello = myService.sayHello("tomcat...");
        return hello;
    }

    @RequestMapping("/succ")
    public String succ(){
        // 这儿直接返回"succ"，那么它就会跟我们视图解析器中指定的那个前后缀进行拼串，来到指定的页面
        return "succ";
    }

}
